package com.zhku.user.feignclient;


import com.zhku.base.model.RestResponse;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class ShopClientFactory implements FallbackFactory<ShopClient> {
    @Override
    public ShopClient create(Throwable throwable) {
        return new ShopClient() {

            @Override
            public RestResponse<TtShop> shopByName(String name) {
                log.debug("调用店铺服务--根据店铺名称判断店铺是否存在熔断异常:{}", throwable.getMessage());
                return null;
            }

        };
    }
}
